package AddonsSheepContoller.ASPlayer.Manager;

import AddonsSheepContoller.ASPlayer.ASPlayer;

public class ASPlayerManagerCenter {
    private ASPlayer[] storageCenter;

    public ASPlayer foundPlayer(String username) {
        for(ASPlayer finder : storageCenter) {
            if(finder.getCoreBukkitPlayer().getName().equalsIgnoreCase(username))
                return finder;
        }

        return null;
    }

    public int foundAccountId(String username) {
        for(int i = 0; i < this.storageCenter.length; i++) {
            if(this.storageCenter[i].getCoreBukkitPlayer().getName().equalsIgnoreCase(username))
                return i;
        }

        return -1;
    }

    public void removeAccount(int index) { this.storageCenter[index] = null; }
    public void addAccount(ASPlayer player) { this.storageCenter[this.storageCenter.length] = player; }
}
